﻿
using System;
using System.Windows;
using System.Windows.Interactivity;

namespace Hotel.UI.Behaviors
{
    public class OpenWindowAction : TriggerAction<DependencyObject>
    {


        public Type WindowType
        {
            get { return (Type)GetValue(WindowTypeProperty); }
            set { SetValue(WindowTypeProperty, value); }
        }

        public static readonly DependencyProperty WindowTypeProperty =
            DependencyProperty.Register("WindowType", typeof(Type), typeof(OpenWindowAction), new PropertyMetadata(null));



        protected override void Invoke(object parameter)
        {
            var windowObj = Activator.CreateInstance(WindowType) as Window;
            windowObj.ShowDialog();
        }
    }
}

